/*
 *    Copyright (c) 2018-2025, bfcloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: bfcloud
 */

//事件考核 页面接口
import request from '@/router/axios'
// 创建事件查询列表
export function eventList(query) {
  return request({
    url: `/appr-event/rckhsjkh/page`,
    method: 'get',
    params: query
  })
}
// 创建事件新增
export function addEvent(obj) {
  return request({
    url: '/appr-event/rckhsjkh',
    method: 'post',
    data: obj
  })
}


//创建本部门以下
export function getMyDept() {
  return request({
    url: '/appr-event/rckhsjkhdx/getMyDept',
    method: 'get',
  })
}

//创建事件子表列表
export function getKhdxList(query) {
  return request({
    url: '/appr-event/rckhsjkhdx/getKhdxList',
    method: 'get',
    params: query
  })
}

// 创建事件编辑
export function updateEvent(obj) {
  return request({
    url: '/appr-event/rckhsjkh',
    method: 'put',
    data: obj
  })
}
export function getNextTaskUser(id) {
  return request({
    url: `/appr-event/rckhsjtask/getNextTaskUser/${id}`,
    method: 'get',
  })
}

// 创建事件提交审核
export function submitAudit(ids) {
  return request({
    url: `/appr-event/rckhsjkh/process/sub/${ids}`,
    method: 'put',
  })
}
//事件获取领导列表
export function getLdList(query) {
  return request({
    url: '/appr-event/rckhsjkhdx/getCqjl/',
    method: 'get',
    params: query
  })
}
//事件主表删除
export function deleteEvent(ids) {
  return request({
    url: `/appr-event/rckhsjkh/${ids}`,
    method: 'delete',
  })
}
//事件子表删除
export function deleteChildEvent(ids) {
  return request({
    url: `/appr-event/rckhsjkhdx/${ids}`,
    method: 'delete',
  })
}
//事件子表保存
export function putObj(obj) {
  return request({
    url: '/appr-event/rckhsjkhdx',
    method: 'put',
    data: obj
  })
}
//考核周期下拉选列表
export function getKhzqSelect() {
  return request({
    url: '/appr-event/routineAssess/getAllKhzq',
    method: 'get'
  })
}
//考核周期获取名字
export function getKhzqName(id) {
  return request({
    url: `/appr-event/routineAssess/getByIdno/${id}`,
    method: 'get'
  })
}

//获取启动的考核项
export function getOpenKhzq() {
  return request({
    url: '/appr-event/routineAssess/defaultno',
    method: 'get'
  })
}

//类别下拉选列表
export function getLbSelect(query) {
  return request({
    url: '/appr-event/rckhsjyjk/getSjyjk/',
    method: 'get',
    params: query
  })
}
//类别下拉选列表
export function getJjxSelect() {
  return request({
    url: '/appr-event/rckhsjkh/getJjx',
    method: 'get'
  })
}

export function changeAss(query){
  return request({
    url: '/appr-event/rckhsjtask/changeAss',
    method: 'get',
    params: query
  })
}
//依据下拉选列表
export function getYjSelect(query) {
  return request({
    url: '/appr-event/rckhsjyjk/getSjyjkbyType',
    method: 'get',
    params: query
  })
}
//模板下拉选列表
export function getMbnameSelect() {
  return request({
    url: '/appr-event/rckhtemplatemain/getTemplateList',
    method: 'get'
  })
}
//人员类依据库列表
export function userList(query) {
  return request({
    url: `/appr-event/rckhsjyjk/page`,
    method: 'get',
    params: query
  })
}
//人员类依据库数据
export function getById(id) {
  return request({
    url: `/appr-event/rckhsjyjk/${id}`,
    method: 'get'
  })
}
//人员类依据库条件查询
export function getSjyjkById(id) {
  return request({
    url: `/appr-event/rckhsjyjk/${id}`,
    method: 'get'
  })
}
// 人员类新增
export function addUserDepot(obj) {
  return request({
    url: '/appr-event/rckhsjyjk',
    method: 'post',
    data: obj
  })
}

//人员类依据库删除
export function removeById(ids) {
  return request({
    url: `/appr-event/rckhsjyjk/${ids}`,
    method: 'delete',
  })
}

//人员类依据库编辑
export function updateUserDepot(obj) {
  return request({
    url: '/appr-event/rckhsjyjk',
    method: 'put',
    data: obj
  })
}

//人员类依据库删除
export function deleteChoose(ids) {
  return request({
    url: `/appr-event/rckhsjyjk/${ids}`,
    method: 'delete',
  })
}

//导入人员依据库数据
export function addUserImport(obj) {
  return request({
    url: '/appr-event/rckhsjyjk/importSjyjk',
    method: 'post',
    data: obj
  })
}

// 依据库数据详情查询
export function dataDetail(id) {
  return request({
    url: `/appr-event/rckhsjyjk/${id}`,
    method: 'get',
  })
}


